<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>已买到商品</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/sixPwd.css"/>
</head>
<style type="text/css">
    body {
        font-size: 14px;
    }

    .aui-content-padded {
        margin: 0 10px;
        padding: 10px 0;
    }

    .addFriend.aui-border:after {
        border-color: #327afa;
    }

    .orderList {
        margin-bottom: 15px;
    }

    .proTitle {
        font-size: 14px;
        line-height: 17px;
        color: #666;
    }

    .proTitleP {
        margin: 8px 0 !important;
        color: #000;
    }

    .proList.aui-list-view .aui-img-object {
        max-width: 70px;
        height: 70px;
        line-height: 70px;
    }

    .orderTitle {
        font-size: 14px;
        padding: 0 12px;
        background: #fff;
        height: 42px;
        line-height: 42px;
    }

    .proPrice {
        text-align: right;
        margin-top: 5px;
    }

    .proList.aui-list-view {
        margin: 0;
    }

    .aui-list-view:after {
        border: none;
    }

    .totalPrice {
        font-size: 18px;
    }

    .proFooter .aui-list-view-cell {
        text-align: right;
    }

    .proMoreHandle {
        overflow: inherit;
        height: 55px;
        padding-right: 1px;
    }

    .proMoreHandle span {
        float: right;
        display: block;
        padding: 5px 8px;
        border-radius: 3px;
        margin-right: 8px;
    }

    .proMoreHandle span.active.aui-border:after {
        border-color: #327afa;
    }

    .proMoreHandle .aui-border:after {
        border-radius: 5px;
    }

    .more {
        position: relative;
        /*margin-right: 0 !important;*/
    }

    .more a {
        /*color: #000;*/
        color: #666;
        font-size: 13px;
    }

    .moreList {
        /*left: -28px;*/
        background: #FFF;
        border-radius: 5px;

    }

    .moreList li {
        padding: 5px 8px;
        width: 100px;
        text-align: center;
    }

    .mui-popover {
        width: 100px;
    }

    .active {
        background: #327afa !important;
        color: #fff !important;
        overflow: hidden;
    }

    /*下面弹出的样式*/
    .pickerToTop {
        position: fixed;
        bottom: 0;
        -webkit-transform: translateY(195px);
        height: 195px;
        overflow-y: auto;
        -webkit-transition: .5s;
        transition: .5s;
        z-index: 999;
        width: 100%;
        text-align: center;
    }

    .toTopAnimate {
        -webkit-transform: translateY(00px);
    }

    .grayColor {
        color: #aaa;
    }
</style>
<body>
<div class="kongshuju">
    <p>暂无数据</p>
</div>
<div class="contain orderLists" id="orderLIst-content">
    <!-- 等待买家付款 -->
    <!--<div class="orderList">
        <div class="orderTitle myBorder">
            <span class="comName">苏州市素絮服饰有限公司2222</span>
            <span class="orderStatus zfBlue aui-pull-right">等待买家付款</span>
        </div>
        <ul class="aui-list-view proList" tapmode onclick="openToTwo('orderInfo')">
            <li class="aui-list-view-cell aui-img">
                <img class="aui-img-object aui-pull-left" src="../../image/shili.jpg">

                <div class="aui-img-body proTitle  aui-col-xs-6">
                    <p class="aui-ellipsis-2 proTitleP">图文列表缩略图在左边的样式，默认大小为80PX，文字介绍内容可以为一行也可以为两行，超出部分自动省略</p>
                    <span class="proColor">藏青</span>
                    <span class="proSize">均码</span>
                </div>

                <div class="aui-img-body proPrice">
                    <span>￥53.60</span>

                    <p>x1</p>
                </div>
            </li>
            <li class="aui-list-view-cell aui-img">
                <img class="aui-img-object aui-pull-left" src="../../image/shili.jpg">

                <div class="aui-img-body proTitle  aui-col-xs-6">
                    <p class="aui-ellipsis-2 proTitleP">图文列表缩略图在左边的样式，默认大小为80PX，文字介绍内容可以为一行也可以为两行，超出部分自动省略</p>
                    <span class="proColor">藏青</span>
                    <span class="proSize">均码</span>
                </div>

                <div class="aui-img-body proPrice">
                    <span>￥53.60</span>

                    <p>x1</p>
                </div>
            </li>
            <li class="aui-list-view-cell aui-img">
                <img class="aui-img-object aui-pull-left" src="../../image/shili.jpg">

                <div class="aui-img-body proTitle  aui-col-xs-6">
                    <p class="aui-ellipsis-2 proTitleP">图文列表缩略图在左边的样式，默认大小为80PX，文字介绍内容可以为一行也可以为两行，超出部分自动省略</p>
                    <span class="proColor">藏青</span>
                    <span class="proSize">均码</span>
                </div>

                <div class="aui-img-body proPrice">
                    <span>￥53.60</span>

                    <p>x1</p>
                </div>
            </li>
        </ul>
        <div class="proFooter">
            <ul class="aui-list-view">
                <li class="sendLink aui-list-view-cell">
                    共2件 总金额:￥<span class="totalPrice">107.20</span>(含运费 ￥10.00)
                </li>
                <li class="aui-list-view-cell proMoreHandle">
                    <span class="aui-border active">付款</span>
                    <span class="aui-border">取消订单</span>
                       <span class="more">
                            &lt;!&ndash; 这个a锚点链接对应下面的id ，后面可以加上订单的id&ndash;&gt;
                            <a href="#bottomPopover">更多</a>
                       </span>
                </li>
            </ul>
            &lt;!&ndash; 这个id对应上面的a锚点链接 ，后面可以加上订单的id&ndash;&gt;
            <div id="bottomPopover" class="mui-popover mui-popover-bottom ">
                <div class="mui-popover-arrow"></div>
                <ul class="moreList aui-border">
                    <li tapmode onclick="hidePopover()">联系卖家</li>
                </ul>
            </div>
        </div>
    </div>-->
    <!-- 买家已付款 -->
    <!--<div class="orderList">
        <div class="orderTitle myBorder">
            <span class="comName">苏州市素絮服饰有限公司</span>
            <span class="orderStatus zfBlue aui-pull-right">买家已付款</span>
        </div>
        <ul class="aui-list-view proList" tapmode onclick="openToTwo('orderInfo')">
            <li class="aui-list-view-cell aui-img">
                <img class="aui-img-object aui-pull-left" src="../../image/shili.jpg">

                <div class="aui-img-body proTitle  aui-col-xs-6">
                    <p class="aui-ellipsis-2 proTitleP">图文列表缩略图在左边的样式，默认大小为80PX，文字介绍内容可以为一行也可以为两行，超出部分自动省略</p>
                    <span class="proColor">藏青</span>
                    <span class="proSize">均码</span>
                </div>

                <div class="aui-img-body proPrice">
                    <span>￥53.60</span>

                    <p>x1</p>
                </div>
            </li>
        </ul>
        <div class="proFooter">
            <ul class="aui-list-view">
                <li class="sendLink aui-list-view-cell">
                    共2件 总金额:￥<span class="totalPrice">107.20</span>(含运费 ￥10.00)
                </li>
                <li class="aui-list-view-cell proMoreHandle">
                    <span class="aui-border">提醒发货</span>
                </li>
            </ul>
        </div>
    </div>-->
    <!-- 卖家已发货 -->
    <!--<div class="orderList">
        <div class="orderTitle myBorder">
            <span class="comName">苏州市素絮服饰有限公司</span>
            <span class="orderStatus zfBlue aui-pull-right">卖家已发货</span>
        </div>
        <ul class="aui-list-view proList" tapmode onclick="openToTwo('orderInfo')">
            <li class="aui-list-view-cell aui-img">
                <img class="aui-img-object aui-pull-left" src="../../image/shili.jpg">

                <div class="aui-img-body proTitle  aui-col-xs-6">
                    <p class="aui-ellipsis-2 proTitleP">图文列表缩略图在左边的样式，默认大小为80PX，文字介绍内容可以为一行也可以为两行，超出部分自动省略</p>
                    <span class="proColor">藏青</span>
                    <span class="proSize">均码</span>
                </div>

                <div class="aui-img-body proPrice">
                    <span>￥53.60</span>

                    <p>x1</p>
                </div>
            </li>
        </ul>
        <div class="proFooter">
            <ul class="aui-list-view" tapmode onclick="openToTwo('orderInfo')">
                <li class="sendLink aui-list-view-cell">
                    共2件 总金额:￥<span class="totalPrice">107.20</span>(含运费 ￥10.00)
                </li>
                <li class="aui-list-view-cell proMoreHandle">
                    <span class="aui-border active">确认收货</span>
                    <span class="aui-border">查看物流</span>
                       <span class="more">
                            &lt;!&ndash; 这个a锚点链接对应下面的id ，后面可以加上订单的id&ndash;&gt;
                            <a href="#bottomPopover1">更多</a>
                       </span>
                </li>
            </ul>
            &lt;!&ndash; 这个id对应上面的a锚点链接 ，后面可以加上订单的id&ndash;&gt;
            <div id="bottomPopover1" class="mui-popover mui-popover-bottom ">
                <div class="mui-popover-arrow"></div>
                <ul class="moreList aui-border">
                    <li tapmode onclick="hidePopover()">快速补货</li>
                    <li tapmode onclick="hidePopover()">延长收货</li>

                </ul>
            </div>
        </div>
    </div>-->
    <!-- 交易成功 -->
    <!--<div class="orderList">
        <div class="orderTitle myBorder" tapmode onclick="openToTwo('orderInfo')">
            <span class="comName">苏州市素絮服饰有限公司</span>
            <span class="orderStatus zfBlue aui-pull-right">交易成功</span>
        </div>
        <ul class="aui-list-view proList">
            <li class="aui-list-view-cell aui-img">
                <img class="aui-img-object aui-pull-left" src="../../image/shili.jpg">

                <div class="aui-img-body proTitle  aui-col-xs-6">
                    <p class="aui-ellipsis-2 proTitleP">图文列表缩略图在左边的样式，默认大小为80PX，文字介绍内容可以为一行也可以为两行，超出部分自动省略</p>
                    <span class="proColor">藏青</span>
                    <span class="proSize">均码</span>
                </div>

                <div class="aui-img-body proPrice">
                    <span>￥53.60</span>

                    <p>x1</p>
                </div>
            </li>
        </ul>
        <div class="proFooter">
            <ul class="aui-list-view">
                <li class="sendLink aui-list-view-cell">
                    共2件 总金额:￥<span class="totalPrice">107.20</span>(含运费 ￥10.00)
                </li>
                <li class="aui-list-view-cell proMoreHandle">
                    <span class="aui-border active">评价</span>
                    <span class="aui-border">查看物流</span>
                       <span class="more">
                            &lt;!&ndash; 这个a锚点链接对应下面的id ，后面可以加上订单的id&ndash;&gt;
                            <a href="#bottomPopover1">更多</a>
                       </span>
                </li>
            </ul>
            &lt;!&ndash; 这个id对应上面的a锚点链接 ，后面可以加上订单的id&ndash;&gt;
            <div id="bottomPopover1" class="mui-popover mui-popover-bottom ">
                <div class="mui-popover-arrow"></div>
                <ul class="moreList aui-border">
                    <li tapmode onclick="hidePopover()">快速补货</li>
                    <li tapmode onclick="hidePopover()">删除订单</li>

                </ul>
            </div>
        </div>
    </div>-->
    <!-- 交易关闭 -->
    <!--<div class="orderList">
        <div class="orderTitle myBorder">
            <span class="comName">苏州市素絮服饰有限公司</span>
            <span class="orderStatus zfBlue aui-pull-right">交易关闭</span>
        </div>
        <ul class="aui-list-view proList" tapmode onclick="openToTwo('orderInfo')">
            <li class="aui-list-view-cell aui-img">
                <img class="aui-img-object aui-pull-left" src="../../image/shili.jpg">

                <div class="aui-img-body proTitle  aui-col-xs-6">
                    <p class="aui-ellipsis-2 proTitleP">图文列表缩略图在左边的样式，默认大小为80PX，文字介绍内容可以为一行也可以为两行，超出部分自动省略</p>
                    <span class="proColor">藏青</span>
                    <span class="proSize">均码</span>
                </div>
                <div class="aui-img-body proPrice">
                    <span>￥53.60</span>

                    <p>x1</p>
                </div>
            </li>
        </ul>
        <div class="proFooter">
            <ul class="aui-list-view">
                <li class="sendLink aui-list-view-cell">
                    共2件 总金额:￥<span class="totalPrice">107.20</span>(含运费 ￥10.00)
                </li>
                <li class="aui-list-view-cell proMoreHandle">
                    <span class="aui-border">删除订单</span>
                </li>
            </ul>
        </div>
    </div>-->
</div>
<script id="orderList-template" type="text/x-dot-template">
    {{ for (var i in it) { }}
    <div class="orderList" dataCompanyName="{{=it[i].company.username}}" id="order{{=it[i].order_id}}">
        <div class="orderTitle myBorder">
            <span class="comName">{{=it[i].company.company}}</span>
            <span class="orderStatus grayColor aui-pull-right">
                {{? it[i].status == 0}}交易关闭
                {{?? it[i].status == -1}}商品下架
                {{?? it[i].status == 1}}等待付款
                {{?? it[i].status == 2}}<span class="zfBlue">等待卖家发货</span>
                {{?? it[i].status == 3}}<span class="zfBlue">卖家已发货</span>
                {{?? it[i].status == 4}}交易成功
                {{?? it[i].status == 5}}已评价
                {{?? it[i].status == 6}}<span class="aui-text-danger">申请退款</span>
                {{?? it[i].status == 7}}<span class="aui-text-danger">申请退货</span>
                {{?}}
            </span>
        </div>
        <ul class="aui-list-view proList" tapmode orderStatus="{{=it[i].status}}" orderId="{{=it[i].order_id}}"
            onclick="openOrderInfo(this)">
            {{ for (var is in it[i].goods) { }}
            <li class="aui-list-view-cell aui-img">
                <img class="aui-img-object aui-pull-left" src="{{=it[i].goods[is].thumb}}">

                <div class="aui-img-body proTitle  aui-col-xs-6">
                    <p class="aui-ellipsis-2 proTitleP">{{=it[i].goods[is].title}}</p>
                    <span class="proColor">{{=it[i].goods[is].note}}</span>
                </div>

                <div class="aui-img-body proPrice">
                    <span>￥{{=it[i].goods[is].amount}}</span>

                    <p>x{{=it[i].goods[is].number}}</p>
                </div>
            </li>
            {{ } }}
        </ul>
        <div class="proFooter">
            <ul class="aui-list-view">
                <li class="sendLink aui-list-view-cell" style="color:#666;font-size: 13px;">
                    共{{=it[i].order_number}}件 总金额：(含运费 ￥{{=it[i].fee}}) &nbsp;<span class="totalPrice aui-text-danger">￥{{=it[i].order_amount}}</span>
                </li>
                <!--未付款-->
                {{? it[i].status == 1}}
                <li class="aui-list-view-cell proMoreHandle zfBlue" id="proMoreHandle{{=it[i].order_id}}">
                    <span class="aui-border active" tapmode orderStatus="{{=it[i].status}}"
                          orderId="{{=it[i].order_id}}" onclick="goToPay(this)">确认付款</span>
                    <span class="aui-border" onclick="cancellationOrder({{=it[i].order_id}})">取消订单</span>
                    <span class="more">
                                <!--这个a锚点链接对应下面的id ，后面可以加上订单的id-->
                                <a tapmode onclick="handleMore(this)" orderPhone="{{=it[i].company.telephone}}"
                                   orderId="{{=it[i].order_id}}"
                                   orderStatus="{{=it[i].status}}" buyer="{{=it[i].company.username}}">更多</a>
                           </span>
                </li>
                <!--已付款-->
                {{?? it[i].status == 2}}
                <li class="aui-list-view-cell proMoreHandle aui-text-danger">
                    <span class="aui-border" data-orderId="{{=it[i].order_id}}"
                          data-sellerName="{{=it[i].company.username}}"
                          onclick="reminderDelivery(this)">提醒发货</span>
                </li>
                <!--已发货-->
                {{?? it[i].status == 3}}
                <li class="aui-list-view-cell proMoreHandle zfBlue" id="proMoreHandle{{=it[i].order_id}}">
                    <span class="aui-border active" onclick="confirmReceipt({{=it[i].order_id}})">确认收货</span>
                    <span class="aui-border" tapmode onclick="openWuLiu('{{=it[i].send_no}}')">查看物流</span>
                    <!--<span class="more">-->
                    <!--<a href="http://m.kuaidi100.com/result.jsp?nu={{=it[i].send_no}}">查看物流</a-->
                    <!--&lt;!&ndash;这个a锚点链接对应下面的id ，后面可以加上订单的id&ndash;&gt;-->
                    <!--<a tapmode onclick="handleMore(this)" orderPhone="{{=it[i].company.telephone}}"-->
                    <!--orderId="{{=it[i].order_id}}"-->
                    <!--orderStatus="{{=it[i].status}}">更多</a>-->
                    <!--</span>-->
                </li>
                <!--交易成功-->
                {{?? it[i].status == 4}}
                <li class="aui-list-view-cell proMoreHandle zfBlue">
                    <span class="aui-border active" tapmode orderId="{{=it[i].order_id}}"
                          goodsId="{{=it[i].goods[0].itemid}}" onclick="goToEvaluate(this)">追加评论</span>
                    <span class="aui-border" tapmode onclick="openWuLiu('{{=it[i].send_no}}')">查看物流</span>
                    <!--<span class="more">-->

                    <!--<a tapmode onclick="handleMore(this)" orderPhone="{{=it[i].company.telephone}}"-->
                    <!--orderId="{{=it[i].order_id}}"-->
                    <!--orderStatus="{{=it[i].status}}">更多</a>-->
                    <!--</span>-->
                </li>
                <!--交易关闭-->
                {{?? it[i].status <= 0}}
                <li class="aui-list-view-cell proMoreHandle aui-text-default">
                    <span class="aui-border" onclick="deleteOrder({{=it[i].order_id}})">删除订单</span>
                </li>
                {{?}}
            </ul>
            <!--这个id对应上面的a锚点链接 ，后面可以加上订单的id-->
            <!--未付款-->
            <!--{{? it[i].status == 1}}-->
            <!--<div id="bottomPopover" class="mui-popover mui-popover-bottom ">-->
            <!--<div class="mui-popover-arrow"></div>-->
            <!--<ul class="moreList aui-border">-->
            <!--<li tapmode onclick="hidePopover()"><a href="tel://{{=it[i].company.telephone}}">联系卖家</a></li>-->
            <!--</ul>-->
            <!--</div>-->
            <!--&lt;!&ndash;已发货&ndash;&gt;-->
            <!--{{?? it[i].status == 3}}-->
            <!--<div id="bottomPopover1" class="mui-popover mui-popover-bottom ">-->
            <!--<div class="mui-popover-arrow"></div>-->
            <!--<ul class="moreList aui-border">-->
            <!--<li tapmode onclick="hidePopover()">快速补货</li>-->
            <!--<li tapmode onclick="hidePopover()">延长收货</li>-->

            <!--</ul>-->
            <!--</div>-->
            <!--&lt;!&ndash;交易成功&ndash;&gt;-->
            <!--{{?? it[i].status == 4}}-->
            <!--<div id="bottomPopover1" class="mui-popover mui-popover-bottom ">-->
            <!--<div class="mui-popover-arrow"></div>-->
            <!--<ul class="moreList aui-border">-->
            <!--<li tapmode onclick="hidePopover()">快速补货</li>-->
            <!--&lt;!&ndash;<li tapmode onclick="hidePopover()">删除订单</li>&ndash;&gt;-->

            <!--</ul>-->
            <!--</div>-->
            <!--{{?}}-->
        </div>
    </div>
    {{ } }}
</script>
<div class="pickerToTop">
    <i class="aui-iconfont aui-icon-roundclose" tapmode onclick="hidePicker()"></i>
    <ul class="aui-list-view youfei">
        <li class="aui-list-view-cell">
            请输入密码
        </li>
        <li class=" ">
            <div class="inputBoxContainer" id="inputBoxContainer">
                <input type="number" class="realInput"/>

                <div class="bogusInput">
                    <input type="password" maxlength="6" disabled/>
                    <input type="password" maxlength="6" disabled/>
                    <input type="password" maxlength="6" disabled/>
                    <input type="password" maxlength="6" disabled/>
                    <input type="password" maxlength="6" disabled/>
                    <input type="password" maxlength="6" disabled/>
                </div>
            </div>
        </li>
        <li class="aui-list-view-cell active aui-text-right">
            忘记密码？
        </li>
    </ul>
</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/jquery-1.11.3.js"></script>
<script type="text/javascript" src="../../script/mui.js"></script>
<script type="text/javascript" src="../../script/sixPwd.js"></script>
<script type="text/javascript" src="../../script/doT.min.js"></script>
<script type="text/javascript">
    var page = 1, isLock = false, status = 0, myOrderId;
    apiready = function () {

        myAvatar = $api.getStorage('avatar');
        targetId = api.pageParam.targetId;
        targetAvatar = api.pageParam.targetAvatar;
        targetNickname = api.pageParam.targetNickname;
        api.parseTapmode();
        if (api.pageParam.status) {
            status = api.pageParam.status;
        }
        //重新加载缓存
        getStorageAll();

        //接收监听
        api.addEventListener({
            name: 'orderStatus'
        }, function (ret) {
            if (ret && ret.value) {
                isLock = false;
                page = 1;
                $("#orderLIst-content").empty();
                status = ret.value.status
                api.refreshHeaderLoading();
                return false;
            }
        });

        //接收监听
        api.addEventListener({
            name: 'makeSureGetPro'
        }, function (ret) {
            if (ret && ret.value) {
                page = 1;
                //我的页面更新订单数
                isLock = false;
                updateOrderNum();
                api.refreshHeaderLoading();
                return false;
            }
        });
        //接收订单详情页的用户删除订单等操作更新订单数量
        api.addEventListener({
            name: 'updateOrderNum'
        }, function (ret) {
            if (ret && ret.value) {
                isLock = false;
                api.refreshHeaderLoading();
            }
        });
        //我的页面更新订单数

        //接收监听支付密码
        api.addEventListener({
            name: "hasPass"
        }, function (ret) {
            if (ret && ret.value.pass) {
                confirmLoad(ret.value.orderId);
            }
        })

        api.setRefreshHeaderInfo({
            visible: true,
            loadingImg: 'widget://image/ptr_pull.png',
            bgColor: '#efeff4',
            textColor: '#959595',
            textDown: '下拉刷新',
            textUp: '松开刷新',
            showTime: true
        }, function (ret, err) {
            isLock = false;
            page = 1;
            orderList(status);
        });
        //监听是否达到底部上拉加载7
        api.addEventListener({
            name: 'scrolltobottom'
        }, function (ret, err) {
            page++;
            if (!isLock) orderList(status, page);
        });

        api.refreshHeaderLoading();
    }

    mui.init({
        swipeBack: true //启用右滑关闭功能
    });
    function hidePopover() {
        mui('.mui-popover').popover('hide');
    }
    $(document).on("touchstart", "body", function () {
        mui('.mui-popover').popover('hide');
    })
    function openWuLiu(orderId) {
//        window.localhost.href='http://m.kuaidi100.com/result.jsp?nu='+orderId
        api.openWin({
            name: 'wuliuInfo_win',
            url: 'wuliuInfo_win.html',
            pageParam: {
                orderId: orderId
            },
            //delay: 300
        });
    }
    //订单列表
    function orderList(status, toPage) {
        if (isLock)return;

        toPage = toPage ? toPage : page;
        if (toPage == 1) api.refreshHeaderLoading();

        data = {
            status: status,
            userName: user_name,
            page: toPage,
        };
        url = "User/orderListUser";
        isLock = true;
        ajaxRequest(url, 'post', data, function (ret, err) {
            api.refreshHeaderLoadDone();
            isLock = false;
            if (ret.status == 1) {
                var content = $api.byId('orderLIst-content');
                var tpl = $api.byId('orderList-template').text;
                var tempFn = doT.template(tpl);
                if (page > 1) {
                    if (!$.trim(ret.msg)) {
                        isLock = true;
                        return;
                    }
                    $api.append(content, tempFn(ret.msg));
                } else {
                    $api.html(content, tempFn(ret.msg));
                }
            } else {
                if (page == 1) {
                    $(".kongshuju").show();
                    $("#orderLIst-content").empty();
                }
                api.toast({
                    msg: '已经加载完',
                    duration: 2000,
                    location: 'bottom'
                });
                isLock = true;
            }
        });
    }
    //去评价
    function goToEvaluate(obj) {
        var goodsId = $(obj).attr("goodsId");
        var orderId = $(obj).attr("orderId");
        var companyName = $(obj).parents(".orderList").attr("dataCompanyName");
        api.openWin({
            name: "evaluate",
            url: "../proEvaluate_win.html",
            vScrollBarEnabled : false,
            hScrollBarEnabled : false,
            pageParam: {
                orderId: orderId,
                goodsId: goodsId,
                companyName: companyName
            }
        })
    }
    function openOrderInfo(obj) {
        var orderId = $(obj).attr("orderId");
        var orderStatus = $(obj).attr("orderStatus");
        api.openWin({
            name: 'orderInfo',
            url: 'orderInfo.html',
            pageParam: {
                orderId: orderId,
                orderStatus: orderStatus
            },
            //delay: 300
        });

    }

    //取消订单
    function cancellationOrder(orderId) {
        if (confirm('确定取消吗')) {
            //订单关闭
            showLoading();
            data = {
                userName: user_name,
                orderId: orderId,
            };
            url = "User/cancellationOrder";
            ajaxRequest(url, 'post', data, function (ret, err) {
                if (ret.status == 1) {
                    api.toast({
                        msg: '修改订单成功',
                        duration: 2000,
                        location: 'bottom'
                    });
                    if (status == 1) {

                        //我的页面更新订单数
                        updateOrderNum();
                        $("#order" + orderId).hide();
                    } else {
                        $('.aui-pull-right').text('交易关闭');
                        $('#proMoreHandle' + orderId).html("<span class='aui-border' onclick='deleteOrder(" + orderId + ")'>删除订单</span>");
                    }
                } else {
                    api.toast({
                        msg: '修改订单失败',
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            });
            hideLoading();
        }
    }

    //删除订单
    function deleteOrder(orderId) {
        if (confirm('确定删除吗')) {
            //订单关闭
            showLoading();
            data = {
                userName: user_name,
                orderId: orderId,
            };
            url = "User/deleteOrder";
            ajaxRequest(url, 'post', data, function (ret, err) {
                if (ret.status == 1) {
                    api.toast({
                        msg: '删除订单成功',
                        duration: 2000,
                        location: 'bottom'
                    });
                    //我的页面更新订单数
                    updateOrderNum();


                    $("#order" + orderId).hide();
                } else {
                    api.toast({
                        msg: '删除订单失败',
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            });
            hideLoading();
        }
    }

    //提醒发货
    function reminderDelivery(obj) {
        var orderId = $(obj).attr('data-orderId');
        var tourser = $(obj).attr('data-sellerName');
        if (confirm('确定提醒吗')) {
            //订单关闭
            showLoading();
            data = {
                userName: user_name,
                orderId: orderId,
                touser: tourser,
            };
            url = "User/sendMessage";
            ajaxRequest(url, 'post', data, function (ret, err) {
                if (ret.status == 1) {
                    api.toast({
                        msg: ret.msg,
                        duration: 2000,
                        location: 'bottom'
                    });
                } else {
                    api.toast({
                        msg: ret.msg,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            });
            hideLoading();
        }
    }

    //确认收货
    function confirmReceipt(orderId) {
        api.openFrame({
            bgColor: 'rgba(0,0,0,0.6)',
            name: 'passWord',
            url: 'passWord.html',
            bounces: false,
            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                h: 'auto'
            },
            pageParam: {
                orderId: orderId
            }
        });
    }
    function confirmLoad(orderId) {
//        订单确认收货
        showLoading();
        data = {
            userName: user_name,
            orderId: orderId,
        };
        url = "User/confirmReceipt";
        ajaxRequest(url, 'post', data, function (ret, err) {
            if (ret.status == 1) {

//                    if (status == 3) {
//                        $("#order" + orderId).hide();
//                    } else {
//                        $('.aui-pull-right').text('交易成功');
//                        $('#proMoreHandle' + orderId).html("<span class='aui-border active'>评价</span><span class='aui-border' tapmode onclick='openWuLiu("{{=it[i].send_no}}")'>查看物流</span><span class='more'><a href='#bottomPopover1'>更多</a></span>");
//                    }
                updateOrderNum();
                api.toast({
                    msg: "已确认收货",
                    duration: 2000,
                    location: 'bottom'
                });
            } else {
                api.toast({
                    msg: ret.msg,
                    duration: 2000,
                    location: 'bottom'
                });
            }
        });
        hideLoading();

    }
    //更多操作s
    function handleMore(obj) {
        var orderStatus = $(obj).attr("orderStatus");
        var orderId = $(obj).attr("orderId");
        var orderPhone = $(obj).attr("orderPhone");
        var buyer = $(obj).attr("buyer");
        if (orderStatus == "1") {
            api.actionSheet({
                title: "请选择操作",
                buttons: ["联系卖家"]
            }, function (ret, err) {
                if (ret.buttonIndex == 1) {
                    goToChat(buyer,"1");
                }
            })
        }


//        switch (orderStatus) {
//            case "1":
//                api.actionSheet({
//                    title: "请选择操作",
//                    buttons: ["联系卖家"]
//                }, function (ret, err) {
//                    if (ret.buttonIndex == 1) {
//                        openToTwo("../chat_win")
//                    }
//                })
//                break;
//            case "3":
//                api.actionSheet({
//                    title: "请选择操作",
//                    buttons: ["快速补货", "延长收货"]
//                }, function (ret, err) {
//                    if (ret.buttonIndex == 1) {
//                        alert("快速补货" + orderId)
//                    } else if (ret.buttonIndex == 2) {
//                        alert("延长收货" + orderId)
//                    }
//                })
//
//                break;
//            case "4":
//
//                api.actionSheet({
//                    title: "请选择操作",
//                    buttons: ["快速补货"]
//                }, function (ret, err) {
//                    if (ret.buttonIndex == 1) {
//                        alert("快速补货" + orderId)
//                    }
//                })
//                break;
//            default:
//                break;
//        }
    }
    boxInput.init(function () {
        var result = boxInput.getBoxInputValue();
    })
    function goToPay(obj) {

        var orderId = $(obj).attr("orderId");
        var orderStatus = $(obj).attr("orderStatus");
        api.openWin({
            name: 'orderInfo',
            url: 'orderInfo.html',
            pageParam: {
                orderId: orderId,
                orderStatus: orderStatus,
                showPayPage: true
            },
            //delay: 300
        });
    }
</script>
</html>